import 'package:get/get_state_manager/get_state_manager.dart';

import 'package:get/get.dart';
import 'package:industry_net/pages/news/main/state.dart';
import 'package:industry_net/pages/news/main/views/content/effect.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

class NewsController extends GetxController {
  final state = NewsState();
  @override
  void onInit() {
    super.onInit();
    getData();
  }

  void getData() {
    state.titles = ['推荐', '视频', '直播', '生物技术', '大国三农', '健康', '生活', '田园'];
    state.contentCtrls = state.titles.map((e) => ContentEffect()).toList();
  }

  @override
  void onClose() {
    state.tabCtrl.dispose();
    super.onClose();
  }

  @override
  void dispose() {
    super.dispose();
  }
}
